{php $menu = subcat('main', 0);}
{php $menu_count = 1}
{loop $menu $n $r}
{if $r[ismenu]}
{php if (count($menu)-1 == $menu_count):} 
<li id="menu_{$r[catid]}" class="bli">
{php else:}
<li id="menu_{$r[catid]}">
{php endif;}
{php $menu_count++}
	<a href="{get_sublink($r[catid])}" title="{$r[catname]}">{$r[catname]}</a>
	<p>{$r[image]}</p>
	<dl>
		{php $submenu = subcat('main', $r[catid])}
		{loop $submenu $sn $sr}
		<dd
		{if $r[catid] == 4} style="clear:both;width:180px;" {/if}
		><a href="{get_sublink($sr[catid])}" title="{$sr[catname]}">{$sr[catname]}</a></dd>
		{/loop}
	</dl>
</li>
{/if}
{/loop}